/**
 * LastAssignedPenalty.java
 *
 * @author Beatrice Bacelli
 * @author Luca Bedogni
 * @author Silvia Righini
 */
package unibo.lsb.logic;

import java.io.Serializable;

/**
 * * This class is a simple holder of a couple PlayerId and a number
 * representing the penalty that has been assigned to the player in the last
 * turn. Note: penalty is not supposed to be the total penalty!
 */
public class LastAssignedPenalty implements Serializable {

	PlayerId player;
	int penalty;

	/**
	 * Constructor
	 * 
	 * @param player
	 * @param penalty
	 */
	public LastAssignedPenalty(PlayerId player, int penalty) {
		super();
		this.player = player;
		this.penalty = penalty;
	}

	/**
	 * Constructor
	 * 
	 * @param player
	 * @param penalty
	 */
	public LastAssignedPenalty(Player player, int penalty) {
		super();
		this.player = player.getPlayerId();
		this.penalty = penalty;
	}

	/**
	 * @return the player
	 */
	public PlayerId getPlayer() {
		return player;
	}

	/**
	 * @return the penalty
	 */
	public int getPenalty() {
		return penalty;
	}

	@Override
	public String toString() {
		return getPlayer().toString() + " penalty " + getPenalty();
	}

}
